import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/index",
    name: "index",

    component: () => import("../views/Index.vue"),
    children: [
      {
        path: "/home",
        name: "home",
        component: () => import("../views/Home.vue"),
      },
      {
        path: "/list",
        name: "list",
        component: () => import("../views/List.vue"),
      },
    ],
  },
  {
    path: "/shopcar",
    name: "shopcar",
    component: () => import("../views/Shopcar.vue"),
  },
  {
    path: "/my",
    name: "my",
    component: () => import("../views/My.vue"),
  },
  {
    path: "/detail",
    name: "detail",
    component: () => import("../views/Detail.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
